import { defineStore } from "pinia";

interface IState {
    show:boolean
}

export const usePrintStore = defineStore({
    // 每个 store 的 id 必须唯一
    id: 'print',
    // state 表示数据源
    state: (): IState => ({
        show:false
    }),
    // actions 用来修改 state
    actions: {
        showPrint(){
            this.$patch((state)=>{
                state.show = true
            })
        },
        closePrint(){
            this.$patch((state)=>{
                state.show = false
            })
        },
    },
})